<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <link type="text/css" rel="stylesheet" href="__STATIC__/layout/js/plugins/raty/demo/css/application.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
    <style>
        .row {
            padding: 0;
            margin: 0;
        }

        .clearFix::after {
            content: ".";
            clear: both;
            display: block;
            overflow: hidden;
            font-size: 0;
            height: 0;
        }

        .clearFix {
            zoom: 1;
        }

        .textC {
            text-align: center;
        }

        .star_w {
            width: 300px
        }
    </style>

</head>

<body class="white-bg" style="color:#333;padding:3px;">
<div class="container white-bg" style="padding:0;margin:0 auto">
    <table class="table table-bordered da_table white-bg text-center" style="margin-bottom:0">


        <tr>
            <td colspan="2">系统评价</td>
            <td style="padding: 0;" colspan="6">
                <table class="table table-bordered">
                    <tr>
                        <td>评价备注</td>
                        <td colspan="5"></td>
                    </tr>
                    <tr>
                        <td>网点合作情况:</td>
                        <td>
                            <div class="col-md-6 star_w" id="a1" data-score="0"></div>
                        </td>
                    </tr>
                    <tr>
                        <td>网点规模:</td>
                        <td>
                            <div class="col-md-6 star_w" id="a2" data-score="0"></div>
                        </td>
                    </tr>
                    <tr>
                        <td>网点知名度:</td>
                        <td>
                            <div class="col-md-6 star_w" id="a3" data-score="0"></div>
                        </td>
                    </tr>
                    <tr>
                        <td>网点所处地理位置:</td>
                        <td>
                            <div class="col-md-6 star_w" id="a4" data-score="0"></div>
                        </td>
                    </tr>
                    <tr>
                        <td>网点客情:</td>
                        <td>
                            <div class="col-md-6 star_w" id="a5" data-score="0"></div>
                        </td>
                    </tr>
                    <tr>
                        <td>竞品是否强势:</td>
                        <td>
                            <div class="col-md-6 star_w" id="a6" data-score="0"></div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2">备注</td>
            <td colspan="6"></td>
        </tr>
    </table>


    <div class="row sub_btn white-bg form-group" style="width:100%;text-align:center;padding: 20px 0">
        <button type="submit" class="btn btn-success" style="margin-right: 15px" id="subEvaluation">提交评价</button>
    </div>
</div>


<!-- 全局js -->
{include file="Public/footer"}
<script type="text/javascript" src="__STATIC__/layout/js/plugins/raty/lib/jquery.raty.min.js"></script>
<script>
    $(function () {
        $.fn.raty.defaults.path = '__STATIC__/layout/js/plugins/raty/lib/img';
        $("#a1").raty({
            click: function (score, evt) {

                var id = $(this).attr('id');
                $('#'+id).data('score', score);
            }
        })
        $("#a2").raty({
            click: function (score, evt) {
                var id = $(this).attr('id');
                $('#'+id).data('score', score);
            }
        })
        $("#a3").raty({
            click: function (score, evt) {
                var id = $(this).attr('id');
                $('#'+id).data('score', score);
            }
        })
        $("#a4").raty({
            click: function (score, evt) {
                var id = $(this).attr('id');
                $('#'+id).data('score', score);
            }
        })
        $("#a5").raty({
            click: function (score, evt) {
                var id = $(this).attr('id');
                $('#'+id).data('score', score);
            }
        })
        $("#a6").raty({
            click: function (score, evt) {
                var id = $(this).attr('id');
                $('#'+id).data('score', score);
                console.log($('#'+id).data('score'))
            }
        })
        $(".star_w").css("width", "300px")

        $('#subEvaluation').on('click', function () {
            var data = {
                a1: $('#a1').data('score'),
                a2: $('#a2').data('score'),
                a3: $('#a3').data('score'),
                a4: $('#a4').data('score'),
                a5: $('#a5').data('score'),
                a6: $('#a6').data('score'),
            }
            $.ajax({
                'type': 'post',
                'url': '{:url("",array("id"=>request()->param("id"),"subEvaluation"=>1))}',
                'data': data,
                'dataType': 'json',
                'success': function (data) {
                    if (data.success) {
                        parent.swal({title: data.msg, type: 'success'}, function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name))
                        })
                    } else {
                        parent.swal(data.msg, '', 'warning')
                    }
                }
            })
        })
    })

</script>
</body>

</html>